using System;
using System.Collections;

namespace PharmacyPharnet.Core.Entity
{
	public class UnitOfMeasureInfoCollection : CollectionBase
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="GUIInfoCollection"/> class.
		/// </summary>
        public UnitOfMeasureInfoCollection()
		{
		}

        public void Add(UnitOfMeasureInfo info)
		{
			if (InnerList.IndexOf(info) < 0)
			{
				List.Add(info);
			}
		}

        public UnitOfMeasureInfo this[int index]
		{
			get
			{
                if(InnerList.Count > 0)
                    return InnerList[index] as UnitOfMeasureInfo;
                //foreach (UnitOfMeasureInfo info in InnerList)
                //{
                //    if (info.Id == id)
                //    {
                //        return info;
                //    }
                //}
				return null;
			}
            set {
                InnerList[index] = value;
            }
		}
	}
}
